﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="NewsFeed.aspx.cs" Inherits="NewsFeed"
    MasterPageFile="~/Default.master" EnableViewState="false" %>

<%@ Register Assembly="DevExpress.Web.v9.2, Version=9.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxCallback" TagPrefix="dxcb" %>
<%@ Register Assembly="DevExpress.Web.v9.2, Version=9.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxTimer" TagPrefix="dxt" %>
<asp:Content ContentPlaceHolderID="head" ID="hd" runat="server" EnableViewState="false">

    <script src="NewsFeed.js" type="text/javascript"></script>
    
    <script src="js/FileUpload.js" type="text/javascript"></script>

    <link href="NewsFeed.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ContentPlaceHolderID="leftMenu" ID="leftnav" runat="server" EnableViewState="false">
    <% Response.Write(GenerateSideMenu()); %>
    
</asp:Content>
<asp:Content ContentPlaceHolderID="content" ID="ctnNewsFeed" runat="server" EnableViewState="false">
    <% if( m_iNewsFeedId == 0 ){ %>
        <% if (m_sxViewUserId != m_sxUID)
           { %>
    <div id="nf_Username">
        <a href="NewsFeed.aspx?uid=<% Response.Write(m_sxViewUserId); %>">
            <img src="upload/avatar/<% Response.Write(m_sxViewUserId); %>.jpg" alt="" class="nfP" onerror="setEmptyUserAvatar(this);"/>
        </a>
        <% Response.Write(m_sxViewUserName); %></div>
        <% } %>
    <ul style="margin-bottom: 20px; width: auto;">
        <li class="m_tabTitle<% Response.Write(GetClass(0)); %>"><a class="m_aTab<% Response.Write(GetClass(0)); %>"
            href="NewsFeed.aspx?uid=<% Response.Write(m_sxViewUserId); %>">
            <img src="images/news.png" />
                <% if (m_sxViewUserId == m_sxUID){ %>News Feed<% } else { %>Wall<% } %></a></li>
        <li class="m_tabTitle<% Response.Write(GetClass(1)); %>"><a class="m_aTab<% Response.Write(GetClass(1)); %>"
            href="NewsFeed.aspx?mode=profile&uid=<% Response.Write(m_sxViewUserId); %>">
            <img src="images/user.png" />
            Profile</a></li>
        <li class="m_tabTitle<% Response.Write(GetClass(2)); %>"><a class="m_aTab<% Response.Write(GetClass(2)); %>"
            href="NewsFeed.aspx?mode=customer&uid=<% Response.Write(m_sxViewUserId); %>">
            <img src="images/relation.png" />
            Customer List</a></li>
    </ul>
    <% if( m_iPageMode == 0 ){ %>
    <textarea id="taStatus" class="taStatus" onfocus="taStatus_Focus(this);" onblur="taStatus_Blur(this);"><% if (m_sxViewUserId == m_sxUID){ %>ada info apa hari ini?<% } else { %>tulis wall temanmu...<% } %></textarea>
    <br /><input type="button" class="btd" id="btStatus" disabled="disabled" onclick="UpdateStatus();" value="Share" />
    <br />
    <br />
    <br />
    <div id="pnlUpdate" runat="server" style="display: block; text-align: center; width: 500px;" />
    <% } %>
    <% } %>
    <div id="pnlNewsFeed" runat="server" />
    <% if (m_iNewsFeedId == 0 && m_iPageMode == 0)
       { %>
    <div class="lnk" onclick="OlderPost_OnClick();">
        Older Posts &darr;
        <div id="pnlOlder" style="display: inline;">
        </div>
    </div>
    <div id="idNewest" runat="server" style="display: none;" />
    <div id="idOldest" runat="server" style="display: none;" />
    <dxt:ASPxTimer ID="tmrNewsFeed" ClientInstanceName="tmrNewsFeed_c"
        runat="server">
        <ClientSideEvents Tick="tmrNewsFeed_c_Tick" />
    </dxt:ASPxTimer>
    <% } %>
    
    <% if (m_iPageMode == 1)
       { %>
       <fieldset class="m_fs_border" id="fs_User">
            <legend>
                <a class="lnk" href="javascript:toggle('User');">
                    User Profile</a>
            </legend>
            <dl class="m_fs">
                <div id="div_User">
                    <% Response.Write(InitUserData()); %>
                </div>
            </dl>
        <% if (m_sxViewUserId == m_sxUID)
           {%>
            <div id="lnk_User" class="lnk" style="float: right; margin-left: 5px;" onclick="redirectTo('UserProfile.aspx');">
                Edit Profile</div>
        <% } %>
        </fieldset>
    <% } %>
    
    <dxcb:ASPxCallback ID="cbkMain" ClientInstanceName="cbkMain_c" runat="server" OnCallback="cbkMain_Callback">
        <ClientSideEvents CallbackComplete="function(s, e) { cbkMain_c_CallbackComplete(e); }" />
    </dxcb:ASPxCallback>
    <dxcb:ASPxCallback ID="cbkUpdate" ClientInstanceName="cbkUpdate_c" runat="server"
        OnCallback="cbkUpdate_Callback">
        <ClientSideEvents CallbackComplete="function(s, e) { cbkUpdate_c_CallbackComplete(e); }" />
    </dxcb:ASPxCallback>
    <dxcb:ASPxCallback ID="cbkOlder" ClientInstanceName="cbkOlder_c" runat="server" OnCallback="cbkOlder_Callback">
        <ClientSideEvents CallbackComplete="function(s, e) { cbkOlder_c_CallbackComplete(e); }" />
    </dxcb:ASPxCallback>
    <dxcb:ASPxCallback ID="cbkComment" ClientInstanceName="cbkComment_c" runat="server"
        OnCallback="cbkComment_Callback">
        <ClientSideEvents CallbackComplete="function(s, e) { cbkComment_c_CallbackComplete(e); }" />
    </dxcb:ASPxCallback>
</asp:Content>
